<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.saturn.sldb.Emergency"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>添加审批人</title>
	<%@ include file="/app/includes/header.jsp"%>
	<script type="text/javascript">
	function updateAudit() {
		$('#save').submit();
	}
	$(function() {
		$('#audit').combobox({
			value : '${discussion.audit}',
			onSelect:function(record){
				$('#audit').val(record.text);
		    }
		});
	});
	
	//适用标准添加默认值
	$.ajax({
	    url:"<%=request.getContextPath()%>/app/system/dict/listDictByType.action?type=sldb.standard",
	    type:"post",
	    datatype:"json",
	    success:function(data){
	        $('#standard').combobox({ 
	            data:data.rows,
	            valueField:'id', 
	            textField:'text',
	            onLoadSuccess: function () { //加载完成后,设置选中第一项
	                var val = $(this).combobox("getData");
	                for (var item in val[0]) {
	                    if (item == "id") {
	                        $(this).combobox("select", val[0][item]);
	                    }
	                }
	            }
	        });        
	    }
	});
	</script>
</head>
<body>
	<div id="panel" class="easyui-panel" title="添加审批人"
		icon="icon-query-form" collapsible="true" style="padding: 10px;">
		
		<form id="save" name="save" method="post" action="<%=request.getContextPath()%>/app/sldb/approval/discussion/addDiscussionAudit.action">
		<input type="hidden" id="id" name="id" value="${discussion.id}">
		<input type="hidden" id="type" name="type" value="2">
			<table>
				<tr align="right">
					<td>审批人:</td>
					<td><select id="audit" class="easyui-combobox" name="audit" url="<%=request.getContextPath()%>/app/system/dict/listDictByType.action?type=sldb.audit" valueField="id"
						textField="text" editable="false" panelHeight="90"></select></td>
					<td>审批金额:</td>
					<td><input type="text" id="money" name="money"  value="${discussion.money}"></td>
				</tr>
			</table>
			<div style="padding: 40px;" >
				<a href="#" onclick="updateAudit()" class="easyui-linkbutton"  iconCls="icon-ok">保存</a>
				<a href="javascript:history.back(-1)" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
			</div>
		</form>
	</div>
</body>
</html>
